home *** CD-ROM | disk | FTP | other *** search
/ ASME's Mechanical Engine…ing Toolkit 1997 December / ASME's Mechanical Engineering Toolkit 1997 December.iso / ai / prlg195b.lzh / GAMES.LZH / POOH.PRO < prev    next >
Text File  |  1986-07-20  |  3KB  |  47 lines

  1. /* 
  2. Note: Paula did not claim the prize of a free type VMI PROLOG
  3. for a demonstration program. However, she is working on making
  4. Pooh smarter, and I anticipate that she shortly will. (R.M). 
  5. */
  6.  
  7.  
  8. /* --------------- POOH : A PRO FOR THE AMATEUR --------------- */
  9. /* -------------- Copyright 1985 Paula McKerall --------------- */
  10.  
  11. /* To wake pooh up, type: hello.<CR> when prompted "?-"         */
  12. /* (Of course, type: consult(pooh).<CR> to get to his house!)   */
  13.  
  14. hello :- print( '\nHello! -- pooh is a program of very little brain,' ),
  15.      print( '\nso please answer with: yes.<CR> if you mean "yes" -' ),
  16.      print( '\nor with: no.<CR> if you mean "no" -' ),
  17.      print( '\nor pooh will get confused!' ), nl,
  18.      print( '\n(If you learn Prolog, you can make him smarter!)' ), nl,
  19.      ask_want.
  20. ask_want :- print( '\nDo you want advice about Prolog?' ), ((yes,
  21.      ask_fun); (sorry; confused)).
  22. ask_fun :- print( '\nDo you like to have fun?' ), ((learn; too_bad);
  23.      confused).
  24. learn :- yes, print( '\nThen please learn Prolog; you will like it.' ),
  25.      print( '\nAnd then you can have a good time with pooh!' ), nl, naptime.
  26. sorry :- no, print( '\nSorry, pooh can only give advice about Prolog.' ),
  27.      print( '\nIf you learned Prolog, you could teach him other things!' ),
  28.      nl, print( '\n(Besides, it is lonely in here; pooh needs a friend!)' ),
  29.      nl, naptime.
  30. too_bad :- no, print( '\nToo bad, because Prolog is fun.' ),
  31.      print( '\nYou might change your mind if you try it!' ), nl,
  32.      print( '\n(Besides, pooh is hungry, and if you learned Prolog,' ),
  33.      print( '\nyou could teach him how to ask for honey!)' ), nl, naptime.
  34. confused :- print( '\nPooh is most definitely confused.'  ), nl, naptime.
  35. yes :- print( '\nPlease tell pooh: yes. or no. ?- ' ), read( yes );
  36.      print( '\nThat is a strange answer. Do you mean yes?- '), read( yes ).
  37. no :- print( '\nCuriouser and curiouser. Do you mean no?- ' ), read( yes );
  38.      print( '\nPooh is getting confused. Do you mean yes?- '), read( no ).
  39. naptime :- print( '\nPooh has to take a nap now.' ),
  40.      print( '\nTo wake him up say: hello.<CR>' ),
  41.      print( '\nOr to quit say: exitsys.<CR>' ).
  42.  
  43. /* This is really a silly little game; pooh behaves himself if you
  44.    give him a chance, but I think it's fun to confuse him. Just don't
  45.    make any errors in the "rules" or you'll get the Prolog error
  46.    messenger, who is smarter than pooh but not as cuddly; unlike the
  47.    error messenger, pooh can't say "No." */